package cn.com.project.web.usermgr.controller;

import cn.com.project.web.usermgr.entity.User;
import cn.com.project.web.usermgr.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Wang
 * @since 2021-10-18
 */
@Api(tags = "用户管理")
@Controller
@RequestMapping("/userController")
public class UserController {

    @Autowired
    private IUserService userService;

    @ApiOperation("通过id查询用户")
    @ApiImplicitParam(name = "id", value = "id", required = true)
    @GetMapping("/getUser")
    @ResponseBody
    public User getUser(Long id) {
        return userService.getById(id);
    }

}
